<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function show() {
            console.log(666);
        }
        let show1 = ()=>{
            console.log(666);
        }
        show();
        show1();
        function getVal(a) {
            console.log(a);
        }
        // 函数只有一个参数时，箭头前面的小括号可以省略
        let getVal1 = a => {
            console.log(a);
        }
        getVal1(777)
        let add = (a,b) => {
            console.log(a+b);
        }
        add(1,2)
        // 有返回值的函数
        let add2 = a => {
            return a+9
        }
        // 省略的写法 add2 = a => a+9
        let add3 = a => a+9
        console.log(add2(1,9));
        console.log(add3(11));
        // 箭头函数的this时外层的this
    </script>
</body>
</html>